import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

class TabHome extends StatefulWidget {
  const TabHome({ Key key }) : super(key: key);
  @override
  TabHomeState createState() => TabHomeState();
}

class TabHomeState extends State<TabHome> {
  bool showLoading = false;

  void _actionLoading() {
    setState(() {
      showLoading = !showLoading;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Center(
      child: Row(
        children: [
          !showLoading ? new Text('home') : new Center(child: new CircularProgressIndicator()),
          RaisedButton(
            onPressed: _actionLoading,
            child: Text(!this.showLoading ? 'show' : 'hide'),
          ),
        ]
      )
    );
  }
}
